package com.example.nutritionmanager.ocr

import android.annotation.SuppressLint
import android.net.Uri
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.activity.compose.setContent
import com.example.nutritionmanager.ui.theme.NutritionManagerTheme
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class OCRResultActivity : AppCompatActivity() {

    @SuppressLint("MissingInflatedId")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        // 获取传递过来的图片 URI
        val imageUri = intent.getStringExtra("imageUri")?.let { Uri.parse(it) }
        setContent {
            NutritionManagerTheme {
                // 创建一个新的 NavController 用于该 Activity
                if (imageUri != null) {
                    OCRResultScreen(uri = imageUri)
                }
            }
        }
    }
}
